package com.example.birdfriends.utils.toSet;

import com.example.birdfriends.pojo.user.User;
import com.example.birdfriends.service.FollowService;
import com.example.birdfriends.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class ToSetData {
    @Autowired
    private FollowService followService = null;
    @Autowired
    private UserService userService = null;

    public List<User> followUserList(Long curLoginUid){
        List<Long> myFollowUids = followService.findFollowedUidsByCurUid(curLoginUid);
        List<User> myFollowUsers = new ArrayList<>();
        for(Long myFollowUid: myFollowUids){
            User user1 = userService.findUserByUid(myFollowUid);
            user1.setPassword("");
            myFollowUsers.add(user1);
        }

        return myFollowUsers;
    }

}
